# $Id$
# Maintainer: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Alcasa Mz <alcasa.mz@gmail.com>

pkgname=sni-qt
pkgver=0.2.6
pkgrel=4
pkgdesc='Qt4 plugin which turns all QSystemTrayIcon into StatusNotifierItems (appindicators)'
arch=('i686' 'x86_64')
url='https://launchpad.net/sni-qt'
license=('LGPL3')
depends=('libdbusmenu-qt4')
makedepends=('cmake')
backup=('etc/sni-qt.conf')
source=("http://launchpad.net/${pkgname}/trunk/${pkgver}/+download/${pkgname}-${pkgver}.tar.bz2"
        'sni-qt.conf')
md5sums=('e84c66e776f7c22c961817387f618c81'
         '5b3fc74b8b7a6b99975312d0411960ed')

prepare() {
  mkdir build

  # Disable building tests
  sed -i '/tests/ d' ${pkgname}-${pkgver}/CMakeLists.txt
}

build() {
  cd build
  cmake ../${pkgname}-${pkgver} \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release
  make
}

package() {
  cd build
  make DESTDIR="${pkgdir}" install

  # Install config file for apps that need "Activate" action
  install -Dm644 "${srcdir}/sni-qt.conf" "${pkgdir}/etc/sni-qt.conf"
}
